package com.swak.http.builder;

import java.util.concurrent.Callable;
import java.util.concurrent.CompletableFuture;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 执行确认器
 * 
 * @author lifeng
 * @date 2021年3月11日 下午5:07:27
 */
@Getter
@Setter
@Accessors(chain = true)
@SuppressWarnings("rawtypes")
public class PendingConfirm {
	private String id;
	private int retryTimes;
	private Callable<CompletableFuture> call;

	public CompletableFuture doCall() {
		try {
			return this.call.call();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}
